package com.example.demo.service;

import com.example.demo.entity.Shift;
import org.apache.ibatis.annotations.Param;
import org.springframework.data.jpa.repository.Query;
import org.springframework.web.bind.annotation.PathVariable;

import java.sql.Date;
import java.util.List;

/**
 * @program:IntelliJ IDEA
 * @Description:
 * @author:Mr.CheCheHuiBujianO
 * @data: 2023/3/26 21:10
 */
public interface ShiftService {
    /**
     *@Description: 保存自动生成的排班表
     *@Param: []
     *@return:int
     *@Author: Mr.Lin
     *@Date: 2023/3/26 21:23
     */
    int save();
    
    /**
     *@Description: 根据店铺id和工作日期进行查找
     *@Param: [storeId, workDate]
     *@return:java.util.List<com.example.demo.entity.Shift>
     *@Author: Mr.Lin
     *@Date: 2023/3/26 21:31
     */
    List<Shift> findByStoreIdAndWorkDate(Integer storeId, Date workDate);


    List<Shift> findByStoreId(Integer storeId);

    List<Shift> findAllByStoreId(Integer storeId);

    List<Shift> findAllByStoreIdAndWorkDate(Integer storeId,Date workDate);

    void insertAll(List<Shift> shiftList);

    int updateAll(List<Shift> shiftList);


    int updateStaffScheduling(@Param("staff_id") Integer staff_id, @Param("store_id")Integer store_id
            , @Param("staff_scheduling")String staff_scheduling, @Param("work_date") Date work_date);

    int updateKeepNowStaffSchedulingByBeginAndEnd(@Param("staff_id")Integer staff_id,@Param("store_id")Integer store_id,
                                           Integer beginTime,Integer endTime, @Param("work_date") java.sql.Date work_date);
    int deleteStaffSchedulingByAllZone(@Param("staff_id")Integer staff_id,@Param("store_id")Integer store_id, @Param("work_date") java.sql.Date work_date);

    int updateEmptyStaffSchedulingByBeginAndEnd(@Param("staff_id")Integer staff_id,@Param("store_id")Integer store_id,
                                                Integer beginTime,Integer endTime, @Param("work_date") java.sql.Date work_date);

    int updateRangeStaffSchedulingByBeginAndEnd(@Param("staff_id")Integer staff_id,@Param("store_id")Integer store_id,
                                                Integer beginTime,Integer endTime, @Param("work_date") java.sql.Date work_date
            ,@Param("origin_start_time")Integer origin_start_time,@Param("origin_end_time")Integer origin_end_time);

    int updateStaffSchedulingByBeginAndEnd(@Param("staff_id")Integer staff_id,@Param("store_id")Integer store_id,
                                                @Param("begin_time") Integer beginTime,@Param("end_time") Integer endTime, @Param("work_date") java.sql.Date work_date);
}
